﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Easy.Models
{
    public class UserAuthentication : AuthorizeAttribute
    {
        //定义用户权限规则  视图响应前验证，查看当前用户是否有效
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            if (!MyAuthentication.IsLogin() || MyAuthentication.GetRights() != "User")
                HttpContext.Current.Response.Redirect("~/Home/Login",true);
            {

            }
        }
    }
}